package cn.lcsjsxy.yxz.methodoverride.exer;

import cn.lcsjsxy.yxz.inheritance.practice1.Mankind;

public class Kids extends Mankind{
    private int yearsOld;

    /*
    定义类Kids继承ManKind，并包括
    成员变量int yearsOld；
    方法printAge()打印yearsOld的值。
    */

    public Kids(){
    }
    public Kids(int yearsOld){
        this.yearsOld = yearsOld;
        }
    public void printAge(){
        System.out.println("I am " + yearsOld + "years old.");
    }
    public int getYearsOld(){
        return yearsOld;
    }
    public void getYearsOld(int yearsOld){
        this.yearsOld = yearsOld;
    }

    /*修改练习1.2中定义的类Kids，在Kids中重新定义employeed()方法，
       覆盖父类ManKind中定义的employeed()方法，
       输出“Kids should study and no job.”
       */
    public void employeed(){
        System.out.println("kids should study and no job");
    }







}
